import {requestSearchList} from "@/api"
const state ={
    searchList:{}
}

const mutations={
    SET_SEARCHLIST_STATE(state,payload){
        state.searchList = payload
    }
}
const actions ={
    async  getSearchList({commit},searchParams){
        const result =  await requestSearchList(searchParams)
            commit("SET_SEARCHLIST_STATE",result)
    }

}
const getters={
    //search子页面的数据
    trademarkList(state){
        return state.searchList.trademarkList
    },
    attrsList(){
        return state.searchList.attrsList
    },
    //Search主页面的数据
    goodsList(){
        return state.searchList.goodsList
    },
}

export default {
    namespaced:true,
    state,
    mutations,
    actions,
    getters
}